from django import forms
from web import models

class BaseForm(object):

    def __init__(self,*args,**kwargs):
        super().__init__(*args,**kwargs)
        for name,item in self.fields.items():
            item.widget.attrs['class']='form-control'
            item.widget.attrs['placeholder']=f'请输入{item.label}'


class InviteForm(BaseForm,forms.ModelForm):
    class Meta:
        model=models.ProjectInvite
        fields = ['period','count']